import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './assets/css/global.css'
// 自定义字体图标
import './assets/font/iconfont.css'
// 引入axois
import axios from 'axios'
import ZkTable from 'vue-table-with-tree-grid'
// 全局注册tree-grid组件
Vue.component(ZkTable.name, ZkTable);
import VueQuillEditor from 'vue-quill-editor'
// 引入nprogress加入进度条
import NProgress from 'nprogress'

Vue.use(VueQuillEditor);
// 设置全局地址调用
axios.defaults.baseURL = 'http://106.13.180.6:8000/proxy/api/';
// 拦截器设置请求头添加Token , 可以展示进度条 start()
axios.interceptors.request.use(config => {
    NProgress.start();
    config.headers.Authorization = window.sessionStorage.getItem('token');
    return config;
});
// response 中可以隐藏进度条 down()
axios.interceptors.response.use(config => {
    NProgress.done();
    return config;
});

// 将axios挂载到全局Vue上面
Vue.prototype.$http = axios;


Vue.config.productionTip = false;

new Vue({
    router,
    render: h => h(App)
}).$mount('#app');
